Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | export function hslaString(hslcolor) { |
||
39 | export function compact(array) { |
||
40 | let index = -1, |
||
41 | length = array ? array.length : 0, |
||
42 | resIndex = 0, |
||
43 | result = []; |
||
44 | |||
45 | while (++index < length) { |
||
46 | let value = array[index]; |
||
47 | if (value) { |
||
48 | result[resIndex++] = value; |
||
49 | } |
||
50 | } |
||
51 | return result; |
||
52 | } |
||
53 | |||
67 |
When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically: